/**
 * Created by Eric on 14-1-5.
 */
define(function (require, exports) {
    var jQuery = require('lib/main');
    require('lib/utils').initPage(jQuery, require('data/login'),exports);
    jQuery(document).ajaxError(function (event, xhr, options, exc) {
//        console.log(event);
//        console.log(options.status);
//        console.log(exc);
//        alert(xhr.responseText);
//        jQuery('#errMsg').attr("text",xhr.status).attr("type","label");
        var statusCode = xhr.status;
        if(statusCode == "404")
        {
            jQuery('#errMsg').text("用户名不存在");
        }
        if(statusCode == "403")
        {
            jQuery('#errMsg').text("密码不正确");
        }
        if(statusCode == "400")
        {
            jQuery('#registerMsg').text("该用户已经被注册");
        }
    });
});